package cn.ruanyun.backInterface.modules.business.good.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.ruanyun.backInterface.modules.business.good.pojo.Good;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 商品数据处理层
 * @author fei
 */
@Repository
public interface GoodMapper extends BaseMapper<Good> {
    @Update("update t_good set put_away = #{putAway} where id = #{id}")
    Integer putAwayGood(@Param("id") String id, @Param("putAway") Integer putAway);

    @Select("select count(1) from t_size_and_rolor where goods_id = #{id}")
    Integer getNumCatById(@Param("id") String id);

    @Update("update t_goods_package set put_away = #{putAway} where id = #{id}")
    Integer putAwayPack(@Param("id") String id, @Param("putAway") Integer putAway);
}